package cn.iocoder.yudao.module.search.api.search.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * RPC 服务 - 搜索批量操作 Response DTO
 *
 * @author 芋道源码
 */
@Schema(description = "RPC 服务 - 搜索批量操作 Response DTO")
@Data
public class SearchBulkRespDTO {

    @Schema(description = "操作耗时(毫秒)", example = "100")
    private Long took;

    @Schema(description = "是否有错误", example = "false")
    private Boolean errors;

    @Schema(description = "操作结果列表")
    private List<BulkOperationResult> results;

    @Schema(description = "批量操作结果")
    @Data
    public static class BulkOperationResult {

        @Schema(description = "操作类型", example = "index")
        private String operation;

        @Schema(description = "文档ID", example = "1")
        private String documentId;

        @Schema(description = "操作状态", example = "200")
        private Integer status;

        @Schema(description = "错误信息", example = "Document not found")
        private String error;

        @Schema(description = "是否成功", example = "true")
        private Boolean success;

    }

}
